﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Entity;

namespace BUL
{
    public class AdvertiesBul
    {
        public static AdvertiesDal dal=new AdvertiesDal();
        public static List<Adverties> Adverties_GetById(string id)
        {
            return AdvertiesDal.Adverties_GetById(id);
        }
        public static List<Adverties> Advertise_GetByTop(string top, string where, string order)
        {
            return dal.Advertise_GetByTop(top, where, order);
        }
        public static List<Adverties> Advertise_GetByAll(string lang)
        {
            return dal.Advertise_GetByAll(lang);
        }
        public static List<Adverties> Advertise_Paging(string CurentPage, string PageSize, string Lang)
        {
            return dal.Advertise_Paging(CurentPage, PageSize, Lang);
        }
        public static List<Adverties> Advertise_GetByPosition(string position, string lang)
        {
            var list = dal.Advertise_GetByAll(lang);
            //var listResult = new List<Adverties>();
            //foreach (Adverties x in list)
            //{
            //    if (x.position == position && x.lang == lang)
            //        listResult.Add(x);
            //}
            //return listResult;

            return list.Where(x => x.position == position && x.lang == lang).ToList();
        }
        //public static string Advertise_ViewByPosition(string position, string lang)
        //{
        //    return Advertise_ViewByPosition(position, lang, false, "", "", "", "");
        //}
        //public static string Advertise_ViewByPosition(string position, string Lang, bool slideShow, string Width, string Height)
        //{
        //    return Advertise_ViewByPosition(position, Lang, slideShow, Width, Height, "", "");
        //}
        //public static string Advertise_ViewByPosition(string position, string Lang, bool slideShow, string Width, string Height, string PlayerPath)
        //{
        //    return Advertise_ViewByPosition(position, Lang, slideShow, Width, Height, PlayerPath, "");
        //}
        public bool Advertise_Insert(Adverties data)
        {
            return dal.Advertise_Insert(data);
        }
        public bool Advertise_Update(Adverties data)
        {
            return dal.Advertise_Update(data);
        }
        public bool Advertise_Delete(string id)
        {
            return dal.Advertise_Delete(id);
        }
       
    }
}
